package com.zbs.framework.swagger.utils.excel;

import lombok.Getter;
import org.apache.poi.ss.usermodel.*;

@Getter
public class ExcelStyleModel {
    // 字体样式
    private String fontName;
    // 字体大小
    private Integer fontSize;
    // 是否换行
    private Boolean isWrapText;
    // 字体颜色
    private IndexedColors fontColor;
    // 是否字体加粗
    private Boolean isBoldWeight;
    // 水平对齐样式
    private HorizontalAlignment alignment;
    // 垂直对齐样式
    private VerticalAlignment verticalAlignment;
    // 背景颜色
    private  IndexedColors backgroundColor;
    // 填充类型
    private FillPatternType fillPatternType;

    //边框样式
    private BorderStyle borderBottom;
    private BorderStyle borderLeft;
    private BorderStyle borderRight;
    private BorderStyle borderTop;

    public static ExcelStyleModel build() {
        return new ExcelStyleModel();
    }


    public ExcelStyleModel borderStyle(BorderStyle borderStyle) {
        this.borderBottom = borderStyle;
        this.borderLeft = borderStyle;
        this.borderRight = borderStyle;
        this.borderTop = borderStyle;
        return this;
    }
    public ExcelStyleModel borderBottom(BorderStyle borderStyle) {
        this.borderBottom = borderStyle;
        return this;
    }
    public ExcelStyleModel borderLeft(BorderStyle borderStyle) {
        this.borderLeft = borderStyle;
        return this;
    }
    public ExcelStyleModel borderRight(BorderStyle borderStyle) {
        this.borderRight = borderStyle;
        return this;
    }
    public ExcelStyleModel borderTop(BorderStyle borderStyle) {
        this.borderTop = borderStyle;
        return this;
    }

    public ExcelStyleModel backgroundColor(IndexedColors backgroundColor,FillPatternType fillPatternType) {
        this.backgroundColor = backgroundColor;
        this.fillPatternType = fillPatternType;
        return this;
    }

    // 加粗
    public ExcelStyleModel boldWeight() {
        this.isBoldWeight = true;
        return this;
    }

    public ExcelStyleModel isWrapText(boolean isWrapText) {
        this.isWrapText = isWrapText;
        return this;
    }

    public ExcelStyleModel fontName(String fontName) {
        this.fontName = fontName;
        return this;
    }

    public ExcelStyleModel fontSize(Integer fontSize) {
        this.fontSize = fontSize;
        return this;
    }

    public ExcelStyleModel fontColor(IndexedColors fontColor) {
        this.fontColor = fontColor;
        return this;
    }

    public ExcelStyleModel alignment(HorizontalAlignment alignment) {
        this.alignment = alignment;
        return this;
    }

    public ExcelStyleModel verticalAlignment(VerticalAlignment verticalAlignment) {
        this.verticalAlignment = verticalAlignment;
        return this;
    }
}
